package StudyCode.summary.Basic.mystring;

import java.util.Arrays;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class StringInsideCharSort {
	public static void main(String[] args) {
		String str = "Hello World";
		System.out.println("Sorted Before:");
		System.out.println(str);
		System.out.println("Sorted After:");
		System.out.println(sort(str));
	}

	private static String sort(String string) {
		char[] charArray = string.toCharArray();
		Arrays.sort(charArray);
		return new String(charArray);
	}
}
